#include "dominion.h"
#include "rngs.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>

int main(int argc, char **argv)
{
	int player, score;
	
	//set up to test player 0
	player = 0;
	score = 0;
	struct gameState *test = newGame();
	
	//set number of cards in hand
	test->handCount[player] = 6;
	
	
	//test score from cards in 6 card hand
	test->hand[player][0] = copper; 
	test->hand[player][1] = curse; //-1
	test->hand[player][2] = duchy; //3
	test->hand[player][3] = province; //6
	test->hand[player][4] = great_hall; //1
	test->hand[player][5] = province; //6
	
	if(scoreFor(player, test) == 15)
		{ 
			printf("Test passed.\n");
		}
	
	else
		printf("Test Failed, Score Is: %d\n", scoreFor(player,test));
		
	//set discard for player 0
	test->discardCount[player] = 8;
	
	//add cards to hand, 
	test->discard[player][0] = copper;
	test->discard[player][1] = curse; //-1
	test->discard[player][2] = duchy; //3
	test->discard[player][3] = province; //6
	test->discard[player][4] = great_hall; //1
	test->discard[player][5] = province; //6
	test->discard[player][6] = estate; // 1
	test->discard[player][7] = silver; 
	
	
	//total = 16
	//score from discard should be added to hand
	if(scoreFor(player, test) == 33)
		{ 
			printf("Test passed.\n");
		}
	
	else
		printf("Test Failed, Score Is: %d\n", scoreFor(player,test));
		
	//add cards to deck
	test->deckCount[player] = 12;
	
	test->deck[player][0] = copper;
	test->deck[player][1] = silver; 
	test->deck[player][2] = gold; 
	test->deck[player][3] = province; //6
	test->deck[player][4] = great_hall; //1
	test->deck[player][5] = smithy;
	test->deck[player][6] = estate; // 1
	test->deck[player][7] = silver; 
	test->deck[player][8] = curse; //-1
	test->deck[player][9] = silver; 
	test->deck[player][10] = gold;
	test->deck[player][11] = province;  //6
	//total for deck = 13
	
	
	if(scoreFor(player, test) == 46)
	{ 
		printf("Test passed.\n");
	}
	
	else
		printf("Test Failed, Score Is: %d\n", scoreFor(player,test));
	

	return 0;
	
}